//document ready
$(function(){
	$('#saveButton').bind('click', save);//添加按钮绑定事件
	
	//$('#removefiles').bind('click', removefiles);//删除行绑定事件
	//$('#uploadfiles').bind('click', function(){uploader.start();});//上传按钮事件绑定
	
	
	
});



function save(){
	var formObject=$("#editForm").serializeObject();
	$.ajax({
		type: "post",
		contentType:"application/json",
		url: "/authenticated/generate/page",
		data:JSON.stringify(formObject),
		dataType:"json",
		success: function(result){
			if(result.success){
				$.messager.alert("提示", "保存成功！");
			}else{
				$.messager.alert("提示", "保存失败！\n"+result.message);
			}
		},
		error: function(){
			$.messager.alert("提示", "请求失败！");
		}
	});
}
